//
//  MyMAPinAnnotationView.m
//  CooperLinker
//
//  Created by 张 晓军 on 16/4/15.
//  Copyright © 2016年 洪雯. All rights reserved.
//

#import "MyMAPinAnnotationView.h"

@implementation MyMAPinAnnotationView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (id)initWithAnnotation:(id<MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image = [UIImage imageNamed:@""];
        self.frame = CGRectMake(0,0, 50, 50);
        
        self.backImageView = [[UIImageView alloc] initWithFrame:self.frame];
        [self addSubview:self.backImageView];
        
        self.markInageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.center.x - 14,self.center.y-14 , 26, 26)];
        [self.markInageView.layer setMasksToBounds:YES];
        self.markInageView.layer.cornerRadius = 13;
        [self.backImageView addSubview:self.markInageView];
        
        self.markLabel = [[UILabel alloc] initWithFrame:CGRectMake( - 20,45, 80, 20)];
        self.markLabel.textAlignment = NSTextAlignmentCenter;
        self.markLabel.font = [UIFont systemFontOfSize:9];
        [self.backImageView addSubview:self.markLabel];
        
    }
    return self;
}

@end
